﻿
using System;
namespace Inovout.NumberGenerator
{
    public class TimeFunction : NumberFunction
    {
        public TimeFunction()
            : this(new string[] { supportedDateFormats[supportedDateFormats.Length-1] })
        {
        }
        public TimeFunction(string[] arguments)
            : base("Time")
        {
            format = arguments[0];
        }
        private static string[] supportedDateFormats = new string[]{
            "h",
            "hh",
            "H",
            "HH",
            "hhmm",
            "hhss",
            "HHmmss"
        };


        public string[] SupportedDateFormats
        {
            get { return supportedDateFormats; }
        }
        private string format;
        public string Format
        {
            get { return format; }
            set { format = value; }
        }
        public override string[] Arguments
        {
            get { return new string[]{ format}; }
        }
        public override string Build()
        {
            return DateTime.Now.ToString(format);
        }
    }
}
